package com.example.szh.fragment.view;

import androidx.databinding.library.baseAdapters.BR;
import androidx.fragment.app.Fragment;

import com.alibaba.android.arouter.launcher.ARouter;
import com.example.mvvmcommon.mvvm.view.BaseActivity;
import com.example.szh.R;
import com.example.szh.databinding.ActivityFragmentBinding;
import com.example.szh.fragment.viewmodel.FragmentViewModel;



public class FragmentActivity extends BaseActivity<ActivityFragmentBinding, FragmentViewModel> {


    @Override
    protected boolean isFullScreen() {
        return false;
    }

    @Override
    protected int initVariable() {
        return BR.vm;
    }


    @Override
    protected int setColor() {
        return R.color.common_blue;
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_fragment;
    }

    //s 代表fragment路由地址
    @Override
    protected void selFragment(String s) {
        super.selFragment(s);
        Fragment fragment = (Fragment) ARouter.getInstance().build(s).navigation();
        getSupportFragmentManager().beginTransaction().replace(R.id.fragm_fg_linear,fragment).show(fragment).commit();
    }


}